'use strict';

angular.module('myApp.view1', ['ngRoute'])

    .config(['$routeProvider', function ($routeProvider) {
        $routeProvider.when('/view1', {
            templateUrl: 'view1/view1.html',
            controller: 'View1Ctrl'
        });
    }])

    .controller('View1Ctrl', function ($http, $scope, MapService) {
        $scope.wInst = undefined;
        $scope.vVariables = undefined;
        $.toaster({
            settings: {
                toaster: {
                    css: {
                        top: '90px',
                        left: '10px'
                    }
                },
                toast:
                    {
                        fade: {in: 'fast', out: 'slow'},

                        display: function ($toast) {
                            return $toast.fadeIn(settings.toast.fade.in);
                        },

                        remove: function ($toast, callback) {
                            return $toast.animate(
                                {
                                    opacity: '0',
                                    height: '0px'
                                },
                                {
                                    duration: settings.toast.fade.out,
                                    complete: callback
                                });
                        }
                    },
                timeout: 5000
            }
        });
        $.toaster('Your message here');
        $.toaster('Your message here', 'Your Title');
        $.toaster('Your message here', 'Your Title', 'danger');
        MapService.initMap();
        $scope.doSearch = function () {
            MapService.doSearch();
        };
        $scope.doNavigation = function () {
            MapService.doNavigation();
        };
    });